scale

abstract fun scale(block: DesignBlock, scale: Float, @FloatRange(from = 0.0, to = 1.0) anchorX: Float, @FloatRange(from = 0.0, to = 1.0) anchorY: Float)

Scales the block and all of its children proportionally around the specified relative anchor point. This updates the position, size and style properties (e.g. stroke width) of the block and its children. With the setting features/implicitUpdatesEnabled off, the call updates only when a block that it reads has no layout yet, as right after an undo. It reads the block, every child of it and each transform parent. That update also lays out every other pending change. Required scope: "layer/resize"

Scaling a page slice changes its size, and the page places its page slices again. A scale of 0 or less on a page slice fails with BLOCK.PAGE_SLICE_SIZE_INVALID.

Parameters

block

the block that should be scaled.

scale

the scale factor to be applied to the current properties of the block.

anchorX

the relative position along the width of the block around which the scaling should occur. (0F = left edge, 0.5F = center, 1F = right edge)

anchorY

the relative position along the height of the block around which the scaling should occur. (0F = top edge, 0.5F = center, 1F = bottom edge)